function plotmesh3(outputdir_in)

global outputdir
if(nargin<1)
  outputdir='mesh_output';
else
  outputdir=outputdir_in;
end

% TITLE INFO --------------------------------------------------------------
disp(' ')
disp('  3D UNSTRUCTURED GRID PLOTTING ROUTINE')
disp(' ')
% END TITLE INFO ----------------------------------------------------------

disp(' Loading grid data: please wait ...');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% READ-IN MESH INFO %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fids = fopen([outputdir '/mesh_tnode.dat'],'r');
if fids==-1
  disp(' ');
  error(['File  ',outputdir,'/mesh_tnode.dat  not found.']);
end
tmp = fscanf(fids,'%d %d %d %d',[4,inf]);
fclose(fids);
t = transpose(tmp(1:4,:));
clear tmp;

fids = fopen([outputdir '/mesh_node.dat'],'r');
tmp = fscanf(fids,'%e',[3,inf]);
fclose(fids);
p = transpose(tmp(1:3,:));
clear tmp;

fids = fopen([outputdir '/mesh_bnd_node.dat'],'r');
tmp = fscanf(fids,'%e',[1,inf]);
fclose(fids);
bnd_node(:,1:3) = p(tmp(:),1:3);
clear tmp;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp(' Finished loading grid data.');
disp(' ');

xmin = min(p(:,1));
xmax = max(p(:,1));
ymin = min(p(:,2));
ymax = max(p(:,2));
zmin = min(p(:,3));
zmax = max(p(:,3));

figure(1);
clf;
simpplot(p,t,'r','y');
axis([xmin xmax ymin ymax zmin zmax]);
set(gca,'plotboxaspectratio',[1 1 1]);
View = [-37.5 30];
caxis([0 1]);
grid on;
axis on;
box off;
set(gca,'fontsize',14);
t1 = title('Mesh Generated by MeshGenC++');
set(t1,'fontsize',14);
hold off;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  CALL EXTRA FUNCTION, SPECIFIED BY USER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
plot_extra